package cn.zjyj.module.zjyj.dal.mysql.riskassessmentinstancerel;

import cn.zjyj.framework.common.common.pojo.PageResult;
import cn.zjyj.framework.datasource.mybatis.core.query.LambdaQueryWrapperX;
import cn.zjyj.framework.datasource.mybatis.core.mapper.BaseMapperX;
import cn.zjyj.module.zjyj.dal.dataobject.riskassessmentinstancerel.RiskAssessmentInstanceRelDO;
import org.apache.ibatis.annotations.Mapper;
import cn.zjyj.module.zjyj.controller.admin.riskassessmentinstancerel.vo.*;

/**
 * 风险评估实例关系 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RiskAssessmentInstanceRelMapper extends BaseMapperX<RiskAssessmentInstanceRelDO> {

    default PageResult<RiskAssessmentInstanceRelDO> selectPage(RiskAssessmentInstanceRelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RiskAssessmentInstanceRelDO>()
                .betweenIfPresent(RiskAssessmentInstanceRelDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(RiskAssessmentInstanceRelDO::getApplyRecordId, reqVO.getApplyRecordId())
                .eqIfPresent(RiskAssessmentInstanceRelDO::getAssessmentDetailId, reqVO.getAssessmentDetailId())
                .eqIfPresent(RiskAssessmentInstanceRelDO::getInstanceId, reqVO.getInstanceId())
                .eqIfPresent(RiskAssessmentInstanceRelDO::getStatus, reqVO.getStatus())
                .eqIfPresent(RiskAssessmentInstanceRelDO::getIdentifyContentCode, reqVO.getIdentifyContentCode())
                .orderByDesc(RiskAssessmentInstanceRelDO::getId));
    }

}